/*
 * main.cc
 *
 *  Created on: Nov 10, 2010
 *      Author: fify
 */

/*
 * Note: This problem should be solved by Java.
 */
#include <iostream>

using namespace std;

int ans[1000];

int main()
{
	int input;

	ans[1] = 0;

	for(int i = 2;i<=1000;i++)
	{
		if(i & 1)
		{
			ans[i] = (ans[i - 1] << 1) - 1;
		}
		else
		{
			ans[i] = (ans[i - 1] << 1) + 1;
		}
	}

	while(cin>>input)
	{
		cout << ans[input] << endl;
	}
}
